using System;

namespace Ro.Norc.ServiceStackClient
{
	/// <summary>
	/// Defines the available webservice call types. This is a class since version 0.5
	/// </summary>
	public class ServiceCallType
	{
		/// <summary>
		/// A reply call does receive a response. It waits for the response before firing the appropiate events
		/// </summary>
		public static readonly ServiceCallType CallOneWay = new ServiceCallType("asynconeway", true);

		/// <summary>
		/// A one way call does not receive any response. It just fires the request and closes the connection.
		/// </summary>
		public static readonly ServiceCallType CallReply = new ServiceCallType("syncreply", false);
		
		/// <summary>
		/// Creates a new ServiceCallType instance
		/// </summary>
		/// <param name='endpointPart'>
		/// The endpoint part that should be appended to the URL of the web-service
		/// </param>
		/// <param name='oneWay'>
		/// True if the web-service call should wait for a full response, False otherwise
		/// </param>
		public ServiceCallType(string endpointPart, bool oneWay)
		{
			EndpointPart = endpointPart;
			OneWay = oneWay;
		}
		
		/// <summary>
		/// Gets the endpoint part that should be appended to the URL of the web-service
		/// </summary>
		public string EndpointPart
		{
			get;
			private set;
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the web-service call should wait for a full response or not
		/// </summary>
		public bool OneWay
		{
			get;
			private set;
		}
	}
}